package org.moparscape.msc.gs.db.task;

import org.moparscape.msc.gs.db.DatabaseTaskEngine;

import java.util.Comparator;

public class TaskComparator implements Comparator<QueryTask> {

    @Override
    public int compare(QueryTask o1, QueryTask o2) {
        return o1.getPriority() == DatabaseTaskEngine.QueryPriority.IMPORTANT
                && o2.getPriority() != DatabaseTaskEngine.QueryPriority.IMPORTANT ? 1 : 0;
    }
}